import tabelContext from '@/components/tabel-context/tabel-context.vue'
import { ref } from 'vue'

function useTabelContext() {
  const contentRef = ref<InstanceType<typeof tabelContext>>()

  function handleQueryClick(queryInfo: any) {
    contentRef.value?.fetchPageListData(queryInfo)
  }

  function handleResetClick() {
    contentRef.value?.fetchPageListData()
  }

  return {
    contentRef,
    handleQueryClick,
    handleResetClick
  }
}

export default useTabelContext
